Properly peform deletion updates when moving over a redirect
authorBrad Jorsch <bjorsch@wikimedia.org>
Sat, 4 Jan 2014 23:41:10 +0000 (18:41 -0500)
committerBrad Jorsch <bjorsch@wikimedia.org>
Sat, 4 Jan 2014 23:46:00 +0000 (18:46 -0500)
When moving over a redirect, WikiPage::doDeleteUpdates is called to do
things like clean up obsolete entries in `redirect` and other tables.
But it doesn't pass a Content object and the WikiPage doesn't have one
cached, so it winds up not actually doing these updates.

Change-Id: I54c90cebfd6bea07137a77bd70acec02cab51084

includes/Title.php

index 88268bb..d300513 100644 (file)
@@ -3891,6 +3891,7 @@ class Title {
 
                if ( $moveOverRedirect ) {
                        $newid = $nt->getArticleID();
+                       $newcontent = $newpage->getContent();
 
                        # Delete the old redirect. We don't save it to history since
                        # by definition if we've got here it's rather uninteresting.
@@ -3898,7 +3899,7 @@ class Title {
                        # a conflict on the unique namespace+title index...
                        $dbw->delete( 'page', array( 'page_id' => $newid ), __METHOD__ );
 
-                       $newpage->doDeleteUpdates( $newid );
+                       $newpage->doDeleteUpdates( $newid, $newcontent );
                }
 
                # Save a null revision in the page's history notifying of the move